package org.sg20.searchengine.sort;

import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;

import java.io.IOException;
import java.util.HashMap;

public class SortMapper extends Mapper<LongWritable, Text, TextReverse, Text> {


    @Override
    protected void map(LongWritable key, Text value, Mapper<LongWritable, Text, TextReverse, Text>.Context context) throws IOException, InterruptedException {
        String[] strs = value.toString().split("\t");
        context.write(new TextReverse(strs[0]), new Text(strs[1]));
    }
}
